Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General whitespace cleanup #7074

Merged
merged 4 commits into from
Jun 19, 2024
Merged

Conversation

respencer
Copy link
Contributor

  • Changed tabs to spaces
  • Deleted trailing spaces
  • Automatically fix code formatting in changed files
  • Delete some more comments

@respencer respencer requested a review from a team as a code owner June 14, 2024 14:58
@respencer respencer requested review from DawoudIO, grayeul, DAcodedBEAT and MrClever and removed request for a team June 14, 2024 14:58
@respencer respencer force-pushed the whitespace-cleanup branch from 9c93cb4 to 86a0749 Compare June 14, 2024 15:32
Copy link
Contributor

@DawoudIO DawoudIO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is all of this manual, how can we stop it moving forward

@respencer
Copy link
Contributor Author

respencer commented Jun 14, 2024

Is all of this manual, how can we stop it moving forward

I don't see much chance of this happening in future. Editing software handles things much better now and we have styleci checking on new commits.

@DAcodedBEAT
Copy link
Contributor

Is all of this manual, how can we stop it moving forward

I don't see much chance of this happening in future. Editing software handles things much better now and we have styleci checking on new commits.

@respencer if you can, consider adding Generic.WhiteSpace.DisallowTabIndent to the phpcs.xml.dist file

@@ -32,28 +22,23 @@
extract(mysqli_fetch_array($rsGroupInfo));

// Abort if user tries to load with group having no special properties.
if ($grp_hasSpecialProps == false) {
if ($grp_hasSpecialProps === false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make sure this works? Typically, these values aren't typed correctly when pulled directly from mysqli functions unless the variables are bound (another reason why things should be moved to the ORM)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure right now, so will revert.

Copy link
Contributor

@DAcodedBEAT DAcodedBEAT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't need to go through each comment to uppercase the first char but since you already did it, I'm not opposed.

The only real concern is the strict equality check change potentially breaking

@DAcodedBEAT
Copy link
Contributor

Is all of this manual, how can we stop it moving forward

I don't see much chance of this happening in future. Editing software handles things much better now and we have styleci checking on new commits.

@respencer if you can, consider adding Generic.WhiteSpace.DisallowTabIndent to the phpcs.xml.dist file

Another thing to consider is adding some "best practice" to a .gitattributes file so git can automatically resolve some bad things from entering

@DAcodedBEAT DAcodedBEAT added this to the 5.9.0 milestone Jun 14, 2024
Copy link
Contributor

@DawoudIO DawoudIO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good PR. Thank you for removing the headers. I was not sure if people would be upset, so I kept them.

I made a few comments nothing big, approving once you address other comment please merge away

</table>
</td>
<form method="get" action="FindFundRaiser.php" name="FindFundRaiser">
<input name="sort" type="hidden" value="<?= $sSort ?>" <table cellpadding="3" align="center">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, why what?

_or()->filterByLastName($searchLikeString, Criteria::LIKE)->
_or()->filterByEmail($searchLikeString, Criteria::LIKE)->
limit(15)->find();
$people = PersonQuery::create()->filterByFirstName($searchLikeString, Criteria::LIKE)->_or()->filterByMiddleName($searchLikeString, Criteria::LIKE)->_or()->filterByLastName($searchLikeString, Criteria::LIKE)->_or()->filterByEmail($searchLikeString, Criteria::LIKE)->limit(15)->find();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the original is easier to read

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, automatically reformatted. Thing with moving it back as it was is it will just be automatically reformatted again at some point in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the automatic reformatter used? I don't think PHPCS would do this since it didn't every time I ran this prior

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHP Intelephense. Installed phpcs earlier today, will see what that does on this file.

Copy link
Contributor Author

@respencer respencer Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the automatic reformatter used? I don't think PHPCS would do this since it didn't every time I ran this prior

phpcs had a lot to complain about, including with how the file was initially. I have yet to figure out how to get phpcbf to care.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I figured out how to get them all happy. Still have no idea why this wasn't an issue previously.

@DawoudIO DawoudIO modified the milestones: 5.9.0, vNext (5.10.0) Jun 15, 2024
@respencer respencer force-pushed the whitespace-cleanup branch from 4f6b438 to b1de5f1 Compare June 17, 2024 19:27
- Changed tabs to spaces
- Deleted trailing spaces
- Automatically fix code formatting in changed files
- Delete some more comments
@respencer respencer force-pushed the whitespace-cleanup branch from b1de5f1 to 6206687 Compare June 18, 2024 12:58
@respencer respencer requested a review from DAcodedBEAT June 18, 2024 13:34
DROP TABLE IF EXISTS `menu_links`;
CREATE TABLE `menu_links` (
`linkId` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`linkId` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're choosing to capitalize keywords, this should be consistent.

  `linkId` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
  `linkName` VARCHAR(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `linkUri` TEXT COLLATE utf8_unicode_ci NOT NULL,

Copy link
Contributor Author

@respencer respencer Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't choose anything, the formatter I used did.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which formatter is this? I don't believe this is documented anywhere and is not in the CI so the formatting was a choice 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't matter, rolled back.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want this formatting to happen and for it to be consistent across devs, we can include it - it would just need to be documented and (if possible) added to the CI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, thank you. It was a bad idea.

Will look at it again at some future date with a different formatter.

Comment on lines 49 to 56
SELECT 0,
fam_ID,
0,
"Original Entry",
fam_EnteredBy,
fam_DateEntered,
"create"
FROM family_fam;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not the biggest fan of this formatting change - from quick glance, it looks like you're just trying to invoke a select but the select is actually being used as inputs for the insert. This previously was indented to express context and now that context is lost unless the reviewer keeps track of the scope in their head at all times

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will revert.

@respencer respencer requested a review from DAcodedBEAT June 18, 2024 15:41
@respencer respencer force-pushed the whitespace-cleanup branch from 09da784 to 39559b5 Compare June 19, 2024 17:11
@respencer respencer merged commit 7118b2e into ChurchCRM:master Jun 19, 2024
3 checks passed
@respencer respencer deleted the whitespace-cleanup branch June 19, 2024 17:20
@DawoudIO DawoudIO modified the milestones: vNext (5.10.0), 5.9.0 Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants